
#include "XBeeHandlerPointer.h"

XBeeHandlerPointer::XBeeHandlerPointer(void (*function)(XBeeResponse*)) {
    attach(function);
}

bool XBeeHandlerPointer::isSet() const {
    return (_function != NULL);
}

void XBeeHandlerPointer::attach(void (*function)(XBeeResponse*)) {
    _function = function;
}

void XBeeHandlerPointer::call(XBeeResponse* xbr) const {
    if(_function)
        (*_function)(xbr);
}

